home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1996 June
/
EnigmA AMIGA RUN 08 (1996)(G.R. Edizioni)(IT)[!][issue 1996-06][EARSAN CD VII].iso
/
earcd
/
cmdity
/
yk212src.lha
/
Yak_2.12_Src
/
WBStartup
/
MMB_Shift.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-10-18
|
1KB
|
55 lines
/*
* MMB_Shift.c
*
* Translates an LMB-MMB event into an Shift LMB-MMB one to allow easy multi selection under
* Workbench or BrowserII.
*
*/
#include <clib/alib_protos.h>
#include <libraries/commodities.h>
#include <devices/inputevent.h>
#include <proto/commodities.h>
#include "Code.h"
#include "yak.h"
#include "MMB_Shift.h"
static CxObj *LMB_MMB_Filter;
static IX lmb_mmb_ix = {
IX_VERSION,
IECLASS_RAWMOUSE,
IECODE_LBUTTON,
0x00FF & (~IECODE_UP_PREFIX),
IEQUALIFIER_MIDBUTTON,
IEQUALIFIER_MIDBUTTON,
0
};
SAVEDS void
MMBShiftFunction(register CxMsg *cxm, CxObj *co)
{
((struct InputEvent *)CxMsgData(cxm))->ie_Qualifier |= IEQUALIFIER_LSHIFT;
}
__regargs void
ToggleMMBShift( BOOL toggle)
{
if (toggle &&
(LMB_MMB_Filter = CxFilter(NULL)))
{
SetFilterIX(LMB_MMB_Filter, &lmb_mmb_ix);
AttachCxObj(broker, LMB_MMB_Filter);
AttachCxObj(LMB_MMB_Filter, CxCustom(MMBShiftFunction, 0L));
}
else
{
/* Unactivate MMB Shift */
DeleteCxObjAll(LMB_MMB_Filter); /* LMB_MMB_Filter may be NULL, it doesn't matter */
}
}